function showResult() {
    let oldPwd = $('#oldPassword').val();
    let newPwd = $('#newPassword').val();
    let repeatPwd = $('#repeatPassword').val();
    if (newPwd === repeatPwd) {
        var params = {
            'oldPwd': oldPwd,
            'newPwd': newPwd
        };
        var settings = {
            url: '/kobe/updateAdminPwd.do',
            method: 'post',
            contentType: 'application/json;charset=UTF-8',
            dataType: 'json',
            data: JSON.stringify(params)
        }
        $.ajax(settings).done(respPwd);
    } else {
        respPwd(false);
    }
}

function respPwd(resp) {
    if (resp) {
        $('#save_result_info').attr('class', 'save_success').text('保存成功!');
        showResultDiv(true);
        window.setTimeout("showResultDiv(false);", 3000);
    } else {
        $('#save_result_info').attr('class', 'save_fail').text('保存失败!');
        showResultDiv(true);
        window.setTimeout("showResultDiv(false);", 3000);
    }
    setTimeout("location.reload(true)", 3000);
}

function showResultDiv(flag) {
    var divResult = document.getElementById("save_result_info");
    if (flag)
        divResult.style.display = "block";
    else
        divResult.style.display = "none";
}